package z.tool.service;

import java.sql.Connection;

public class TransactionStruct {
    private boolean autoCommit;

    private Connection connection;

    private int step;

    public TransactionStruct(boolean autoCommit) {
        this.autoCommit = autoCommit;
    }

    public void decreStep() {
        step--;
    }

    public Connection getConnection() {
        return connection;
    }

    public int getStep() {
        return step;
    }

    public void increStep() {
        step++;
    }

    public boolean isAutoCommit() {
        return autoCommit;
    }

    public boolean isStepDone() {
        return 0 == step;
    }

    public void setConnection(Connection connection) {
        this.connection = connection;
    }
}
